 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<table width="100%" border="0"  align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td rowspan="3" class="Text_12_black">
		 <div align="left"><span> &nbsp;&nbsp;&nbsp;: :<a href="<?php echo $this->webroot;?>admin/" class="Link_Title_12_black">Trang chính</a></span> <span >&gt;&gt; </span><a href="<?php echo $this->webroot;?>admin/banners/"class="Link_Text_12_black" >Danh sách banner quảng cáo </a></div>
         <table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
      <tbody>
       <tr>
          <td width="12"><img src="<?php echo $this->webroot;?>img/CM1_01.gif" height="11" width="12" /></td>
          <td colspan="2" background="<?php echo $this->webroot;?>img/CM1_02.gif"><img src="<?php echo $this->webroot;?>img/spacer.gif" height="11" width="12" /></td>
          <td width="11"><img src="<?php echo $this->webroot;?>img/CM1_03.gif" height="11" width="11" /></td>
        </tr>
        <tr>
          <td width="12" height="30" background="<?php echo $this->webroot;?>img/CM1_08.gif"><img src="<?php echo $this->webroot;?>img/spacer.gif" height="10" width="12" /></td>
          <td height="30" colspan="2" align="center" bgcolor="#E2E2E2"><span class="Title_14_Red">Sửa thông tin banner quảng cáo</span></td>
          <td valign="top" background="<?php echo $this->webroot;?>img/CM1_06.gif"><img src="<?php echo $this->webroot;?>img/spacer.gif" height="10" width="11" /></td>
        </tr>
        <tr>
          <td width="12" height="100%" background="<?php echo $this->webroot;?>img/CM1_08.gif">&nbsp;</td>
          <td height="100%" colspan="2" align="left">
		  <table class="antiintro" cellspacing="0" cellpadding="0" width="100%"
        border="0" style="border:#CCCCCC 1px solid;">
              <tbody>
                <tr>
                <td>
				<div class="banners form">
				<?php echo $this->Form->create('Banner', array('type' => 'file'));?>
  					<table width="100%" align='left' cellpadding="2" cellspacing="1" class="add">
					<tr>
					  <td class='label'>&nbsp;</td>
					  <td>&nbsp;</td>
					  </tr>
 					<tr>
						<td class='label' width="150">Tiêu đề</td>
						<td><?php echo $this->Form->input('name',array('label'=>false, 'style'=>'width:300px;'));?>
						<?php echo $this->Form->hidden('id',array('value'=>$this->data['Banner']['id']));?>
						</td>
					</tr>
                    <?php
							$fil= $this->data['Banner']['image'];
							if($fil !=''){
					?>

					<tr>
						<td class='label'>Ảnh cũ</td>
						<td align="left" valign="middle">
						<div id='delfile'>
						<img border='0' src='<?php echo $this->webroot;?>files/uploads/banners/<?php echo $fil;?>' />
						<br/>
						<a href='#' class='delete'>Xóa ảnh</a><span id="load" style='display:none;'>Đang xóa...</span>
						</div>
						</td>

					</tr>

					<?php }?>
					<tr>
						<td class='label'>Ảnh</td>
						<td><?php  echo $this->Form->input('image',array('label'=>false,'type' => 'file'));?></td>
					</tr>
 					<tr>
						<td class='label'>Liên kết</td>
						<td><?php echo $this->Form->input('link',array('label'=>false, 'type' => 'text', 'style'=>'width:300px;'));?></td>
					</tr>
					<tr>
						<td class='label'>Thứ tự</td>
						<td><?php  echo $this->Form->input('order',array('label'=>false, 'style'=>'width:120px;'));?></td>
					</tr>
                   <!--  <tr>
						<td class='label'>Vùng quảng cáo</td>
						<td><?php  echo $this->Form->input('location_id',array('label'=>false, 'style'=>'width:120px;'));?></td>
					</tr> -->
 					<tr>
						<td class='label'>Trạng thái</td>
						<td><?php  echo $this->element('statusedit');?></td>
					</tr>

					<tr>
						<td colspan="2"><?php echo $this->element('button');?></td>
					</tr>
					<tr>
						<td class='label' colspan="2"></td>
					</tr>
				</table>
  				</div>
				</td>
              </tr>

            </tbody>

          </table>          </td>
          <td valign="top" background="<?php echo $this->webroot;?>img/CM1_06.gif">&nbsp;</td>
        </tr>

        <tr>
          <td width="12"  background="<?php echo $this->webroot;?>img/CM1_08.gif"></td>
          <td align="center" valign="middle" width="637">&nbsp;</td>
          <td colspan="2" align="right"><img src="<?php echo $this->webroot;?>img/CM1_16.gif" border="0" height="23" width="22" /><img src="<?php echo $this->webroot;?>img/CM1_07.gif" border="0" height="23" width="11" /></td>
          </tr>
        <tr>
          <td width="12" style="height: 12px;"><img src="<?php echo $this->webroot;?>img/CM1_08.gif" border="0" height="30" width="12" /></td>
          <td style="height: 12px;" align="center" valign="middle" width="637"><a href="javascript:window.history.back(-1);" class="Link_Text_12_black"><img src="<?php echo $this->webroot;?>img/back.gif" align="absmiddle" border="0" /> Trang trước</a>&nbsp;<a href="#top" class="Link_Text_12_black"><img src="<?php echo $this->webroot;?>img/top.gif" align="absmiddle" border="0" /> Đầu trang</a></td>
          <td colspan="2" align="right" style="height: 12px;"><img src="<?php echo $this->webroot;?>img/CM1_10.gif" border="0" height="30" width="38" /><img src="<?php echo $this->webroot;?>img/CM1_11.gif" height="30" width="11" /></td>
          </tr>
        <tr>
          <td width="12"><img src="<?php echo $this->webroot;?>img/CM1_12.gif" height="13" width="12" /></td>
          <td background="<?php echo $this->webroot;?>img/CM1_13.gif" width="637"><img src="<?php echo $this->webroot;?>img/spacer.gif" height="13" width="10" /></td>
          <td align="right" background="<?php echo $this->webroot;?>img/CM1_13.gif"><img src="<?php echo $this->webroot;?>img/CM1_14.gif" height="13" width="38" /></td>
          <td bgcolor="#0000FF"><img src="<?php echo $this->webroot;?>img/CM1_15.gif" height="13" width="11" /></td>
        </tr>
      </tbody>
    </table>
		</td>

      </tr>
</table>

<script>   
   var title = 'Sửa thông tin banner';   
	function submitform(){
		document.fview.submit();
	}
 </script>
 <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(function() {
$(".delete").click(function() {
$('#load').fadeIn();
var commentContainer = $(this).parent();
var id = $(this).attr("id");
var string = 'id='+ id ;

$.ajax({
   type: "POST",
   url: "<?php echo $this->webroot;?>banners/delfile/<?php echo $this->data['Banner']['id'];?>",
   data: string,
   cache: false,
   success: function(){
	commentContainer.slideUp('slow', function() {$('#delfile').remove();});
	$('#load').fadeOut();
  }
 });

return false;
	});
});


</script>
